<template>
  <div class="app-container">
      <div>{{companyForm.title}}</div>

    <div slot="footer" class="dialog-footer">
      <el-button @click="handleCannel()">
        取消
      </el-button>
      <el-button v-if="companyForm.status.value === 5" type="danger" @click="handleDelete(companyForm)">
        删除
      </el-button>
    </div>

  </div>
</template>

<script>
import { getCompanyDetail, removeCompanyByID } from '@/api/mechanism/company'
import waves from '@/directive/waves' // waves directive
import { parseTime } from '@/utils'
import Pagination from '@/components/Pagination' // secondary package based on el-pagination

export default {
  name: 'ComplexTable',
  components: { Pagination },
  directives: { waves },
  filters: {
    statusFilter(status) {
      const statusMap = {
        published: 'success',
        draft: 'info',
        deleted: 'danger'
      }
      return statusMap[status]
    }
  },
  data() {
    return {
      companyForm: {
        ID: undefined,
        remark: '',
        company_ID: 0,
        title: '',
        status: 1
      }
    }
  },
  created() {
    let companyID = this.$route.query && this.$route.query.companyID
    companyID = parseInt(companyID)
    getCompanyDetail({
      "companyID":companyID
    }).then(response => {
      if (response.status === 200) {
        this.companyForm = response.data
      } else {
        this.$message({
          message: response.msg,
          type: 'error'
        })
      }
    })
  },
  methods: {
    handleCannel() {
      this.$router.push({ path: 'company' })
    },
    handleModifyStatus() {
    }
  }
}
</script>
